{
 "metadata": {
  "name": "",
  "signature": "sha256:dfc9d2b98c94fb77d24b47963ad85f330941fa41ebdfc1dbf857074f722f2d89"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "This is a notebook that is being developed to try out some of the unit testing for SDT3D."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import time\n",
      "sdt_addr=\"127.0.0.1\"\n",
      "sdt_port=5000"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 140
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Init SDT3d socket and connect\n",
      "import socket\n",
      "sdtsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
      "sdtsock.connect((sdt_addr,sdt_port))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 141
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "delay=5\n",
      "# Turn of all layers\n",
      "sdtsock.sendall('status \"Layers Off Test\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind,off\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt,off\" ')\n",
      "sdtsock.sendall('layer \"All Layers::User Defined,off\" ')\n",
      "time.sleep(delay)\n",
      "# Turn of all layers\n",
      "sdtsock.sendall('status \"Layers On Test\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind,on\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt,on\" ')\n",
      "sdtsock.sendall('layer \"All Layers::User Defined,on\" ')\n",
      "time.sleep(delay)\n",
      "# Customize a set of layers\n",
      "sdtsock.sendall('status \"Layers Custom\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind,off\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt,off\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind::Earth at Night\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind::Atmosphere\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Worldwind::View Controls\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt::Node Symbols\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt::Node Labels\" ')\n",
      "sdtsock.sendall('layer \"All Layers::User Defined,on\" ')\n",
      "time.sleep(delay)\n",
      "# User layers\n",
      "sdtsock.sendall('layer TestLayer1 ')\n",
      "sdtsock.sendall('layer TestLayer2 ')\n",
      "sdtsock.sendall('layer TestLayer3 ')\n",
      "sdtsock.sendall('layer TestLayer4 ')\n",
      "cmd='flyTo \"0,0,500000,X,X,1\" '\n",
      "sdtsock.sendall(cmd)\n",
      "time.sleep(delay)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 142
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "cmd='flyTo \"-76.005217,39.119009,100000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "time.sleep(delay)\n",
      "# Position node and symbols at geodesic coordinates\n",
      "sdtsock.sendall('status \"Basic Node Tests\" ')\n",
      "cmd='node node1 symbol sphere,red,50,x,x,1.0 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node1 pos \"-77.005217,38.819009,5000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node2 symbol cube,blue,200,x,x,0.75 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node2 pos \"-76.005217,38.819009,10000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node3 symbol sphere,yellow,500,x,x,0.5 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node3 pos \"-75.005217,38.819009,20000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "# Position node at geodesic coordinates\n",
      "cmd='node node4 symbol sphere,purple,50,x,x,1.0 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node4 pos \"-77.005217,39.119009,5000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node5 symbol cube,green,200,x,x,0.75 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node5 pos \"-76.005217,39.119009,10000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node6 symbol cone,white,500,x,x,0.5 '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='node node6 pos \"-75.005217,39.119009,20000\" '\n",
      "sdtsock.sendall(cmd)\n",
      "time.sleep(delay)\n",
      "sdtsock.sendall('layer \"All Layers::Sdt::Node Labels,off\" ')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 135
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Position node and symbols at geodesic coordinates\n",
      "sdtsock.sendall('status \"Basic Node Tests\" ')\n",
      "sdtsock.sendall('layer \"All Layers::Sdt::Network Links\" ')\n",
      "cmd='link node1,node2,wifi line blue,3 linklabel on '\n",
      "sdtsock.sendall(cmd)\n",
      "cmd='link node1,node2,UHF line red,7 linklabel on '\n",
      "sdtsock.sendall(cmd)\n",
      "time.sleep(delay)\n",
      "cmd='unlink node1,node2,wifi '\n",
      "sdtsock.sendall(cmd)\n",
      "time.sleep(delay)\n",
      "cmd='unlink node1,node2,UHF '\n",
      "sdtsock.sendall(cmd)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 136
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Clear All\n",
      "cmd='clear all nodes '\n",
      "sdtsock.sendall(cmd)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 139
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}